package cn.wolfcode.service;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.query.EmployeeQueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

public interface IEmployeeService {
	void insert(Employee employee, Long[] ids);

	/**
	 * 导入
	 * @param file
	 * @throws IOException
	 */
	void importXls(MultipartFile file) throws IOException;

	void delete(Long id);

	/**
	 * 批量删除
	 * @param ids
	 */
	void batchDelete(Long[] ids);

	void update(Employee employee, Long[] ids);

	/**
	 * 修改密码
	 * @param id
	 * @param newPassword
	 */
	void updatePassword(Long id, String newPassword);

	/**
	 * 修改状态(禁用/恢复)
	 * @param id
	 */
	void updateStatus(Long id);

	Employee get(Long id);

	List<Employee> selectAll();

	/**
	 * 分页
	 * @param qo
	 * @return
	 */
	PageInfo<Employee> query(EmployeeQueryObject qo);

	/**
	 * 根据id 查询员工拥有的权限表达式
	 * @param id
	 * @return
	 */
	List<String> selectByEmployeeIdForExpression(Long id);

	/**
	 * 根据id 和name 查询员工对象
	 * @param username
	 * @param id
	 * @return
	 */
	Employee selectByUsernameAndId(String username, Long id);

	/**
	 * 导出
	 * @return
	 */
	Workbook exportXls();

	List<Employee> selectByRoleSn(String...sns);
}
